<?php

use App\Article;
use Illuminate\Database\Seeder;

class ArticlesTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //
        // Let's truncate our existing records to start from scratch.
        Article::truncate();

        $faker = \Faker\Factory::create();

        // And now, let's create a few articles in our database:
        for ($i = 0; $i < 50; $i++) {
            Article::create([
                'title' => $faker->sentence,
                'html_content' => $faker->paragraph,
                'origin_content' => $faker->paragraph,
                'status' => random_int(1,10),
                't_id' => random_int(1,1000000),
                'origin' => $faker->sentence,
                'is_share' => random_int(1,10),
                'published_at' => time(),
                'remark' => $faker->sentence,
            ]);
        }
    }
}
